The French king Louis XIV sought to strengthen his northern border by adding the Spanish Netherlands to his domain.
Angered by the lack of support from the Dutch in this operation, he decided to attack the Dutch republic.
He marched north, bypassing Maastricht, but when his supply lines were threatened he turned around and attacked the city.
It was a hard nut to crack: 6,000 defenders behind walls with five hornworks, a flooded ditch and many demi-lunes.
In charge of the siege was Sébastien Le Prestre de Vauban.
After constructing circumvallation and contravellation walls, he applied the tactic of digging a trench parallel to the city walls, like the Ottomans had done before.
But he expanded on the idea by digging multiple parallel trenches.
The first trench was dug just outside cannon range.
Next other trenches zigzagged forward, then another parallel trench was made and the artillery moved forward.
This pattern was repeated until the last trench almost hugged the walls.
The trenches allowed the besiegers to approach the walls in relative safety.
Once they reached the base of the fortifications, mines could be planted and the walls became vulnerable to an assault.
Vauban's trench-system became standard practice in sieges up to the 20th century CE.
Louis pressed his army to take the city before 24 June, the feast day of Saint John the Baptist.
After some difficult fighting the frontlines of the 45,000 French managed to take a fortification in the southwest, towards which Vauban's efforts had been directed.
Now confident of success, Louis sent his generals home so that he could claim the victory for himself.
However most of the attackers were soon driven out by the garrison, though 30 men held out all night.
An English contingent under the command of the duke of Monmouth sought another way in, but half of them were Dutch, who refused to fight against their fellow countrymen.
Despite this problem, Monmouth launched two attacks on the city, both of which were repulsed.
The next day Louis reverted to more conventional tactics, battering the city with cannon fire.
After a week the defending commander Jacques de Fariaux realized that his position was untenable.
He negotiated a surrender and was allowed to march out of the city with military honors.
The French went on with the war to drive the Netherlands into a very tight spot, yet could not break them.
After a few years a peace treaty was signed, which brought Maastricht partly under rule from the Netherlands, partly from Liege.
Vauban led many more sieges and also constructed many fortifications, becoming France's most celebrated fort-builder.
War Matrix - Siege of Maastricht
Age of Reason 1620 CE - 1750 CE, Battles and sieges